package cn.tedu.di;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Student {
    private String name ="jack";
    //di：是把相关的对象的信息，自动装配 --相当于底层帮你给属性提供了get/set
    @Autowired//相当于底层会帮你给属性提供get/set --自动装配
    private Teacher teacher;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", teacher=" + teacher +
                '}';
    }
}
